/**
 * Created by wumu on 5/30/18.
 */
import fetch from '../utils/fetch'

export function selectDevice(data){
    return fetch({
        url: '/device/select/selectDevice',
        method: 'post',
        params:data
    })
}

export function getSwitchList(data){
    return fetch({
        url: '/device/select/devicetable',
        method: 'post',
        data
    })
}

export function getBuildCollection(data) {
    return fetch({
        url:'/collection/device/devicelist/build/list?buildId='+data,
        method:'get'
    })
}
export function getSwitchStatistics() {
    return fetch({
        url:'/statistical/lightInfo',
        method:'get'
    })
}
export function controlSwitch(data) {
    return fetch({
        url:'/switch/set',
        method:'post',
        data
    })
}
export function batchControlSwitch(data) {
    return fetch({
        url:'/switch/batchSet',
        method:'post',
        data
    })
}

export function batchSwitch(data) {
    return fetch({
        url:'/switch/batch',
        method:'post',
        data
    })
}
export function getSceneList() {
    return fetch({
        url:'/piece/user',
        method:'get',
    })
}

export function deleteScene(id) {
    return fetch({
        url:'/piece/'+id,
        method:'delete'
    })
}

export function addScene(data) {
    return fetch({
        url:'/piece/add',
        method:'post',
        data
    })
}

export function updateScene(data) {
    return fetch({
        url:'/piece/update',
        method:'put',
        data
    })
}

export function getSceneSwitch(data) {
    return fetch({
        url:'/pieceControl/list',
        method:'get',
        params:data
    })
}

export function deleteSceneSwitch(data) {
    return fetch({
        url:'pieceControl/'+data,
        method:'delete'
    })
}

export  function addSceneSwitch(data) {
    return fetch({
        url:'pieceControl/add',
        method:'post',
        data
    })
}

export function controlSceneSwitch(data) {
    return fetch({
        url:'/switch/piece',
        method:'post',
        params:data
    })
}
